hdr->seq = info.seq;
hdr->type = msg_type;
hdr->host = info.desc.host_id;
- hdr->flags = msg_flags;
+ hdr->flags = msg_flags | TI_SCI_FLAG_REQ_ACK_ON_PROCESSED;
xfer->tx_message.buf = tx_buf;
xfer->tx_message.len = tx_message_size;
return -EINVAL;
}
+ if (!(hdr->flags & TI_SCI_FLAG_RESP_GENERIC_ACK))
+ return -ENODEV;
+
return 0;
}
return 0;
}
-/**
- * ti_sci_is_response_ack() - Generic ACK/NACK message check
- *
- * @r: pointer to response buffer
- *
- * Return: true if the response was an ACK, else returns false
- */
-static inline bool ti_sci_is_response_ack(void *r)
-{
- struct ti_sci_msg_hdr *hdr = r;
-
- return hdr->flags & TI_SCI_FLAG_RESP_GENERIC_ACK ? true : false;
-}
-
/**
* ti_sci_device_set_state() - Set device state
*
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_DEVICE_STATE,
- flags | TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_DEVICE_STATE, flags,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
if (clcnt)
*clcnt = resp.context_loss_count;
if (resets)
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_DEVICE_RESETS,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_DEVICE_RESETS, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_CLOCK_STATE,
- flags | TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_CLOCK_STATE, flags,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
if (!programmed_state && !current_state)
return -EINVAL;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_GET_CLOCK_STATE,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_GET_CLOCK_STATE, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
if (programmed_state)
*programmed_state = resp.programmed_state;
if (current_state)
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_CLOCK_PARENT,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_CLOCK_PARENT, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_GET_CLOCK_PARENT,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_GET_CLOCK_PARENT, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
*parent_id = resp.parent_id;
return 0;
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_GET_NUM_CLOCK_PARENTS,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
*num_parents = resp.num_parents;
return 0;
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_QUERY_CLOCK_FREQ,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_QUERY_CLOCK_FREQ, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
*match_freq = resp.freq_hz;
return 0;
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_CLOCK_FREQ,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SET_CLOCK_FREQ, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_GET_CLOCK_FREQ,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_GET_CLOCK_FREQ, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
*freq = resp.freq_hz;
return 0;
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SYS_RESET,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SYS_RESET, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TISCI_MSG_PROC_REQUEST,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TISCI_MSG_PROC_REQUEST, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TISCI_MSG_PROC_RELEASE,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TISCI_MSG_PROC_RELEASE, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TISCI_MSG_PROC_HANDOVER,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TISCI_MSG_PROC_HANDOVER, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TISCI_MSG_SET_PROC_BOOT_CONFIG,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TISCI_MSG_SET_PROC_BOOT_CONFIG, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TISCI_MSG_SET_PROC_BOOT_CTRL,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TISCI_MSG_SET_PROC_BOOT_CTRL, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TISCI_MSG_PROC_AUTH_BOOT_IMIAGE,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TISCI_MSG_PROC_AUTH_BOOT_IMIAGE, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TISCI_MSG_GET_PROC_BOOT_STATUS,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TISCI_MSG_GET_PROC_BOOT_STATUS, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
*bv = (resp.bootvector_low & TISCI_ADDR_LOW_MASK) |
(((uint64_t)resp.bootvector_high << TISCI_ADDR_HIGH_SHIFT) &
TISCI_ADDR_HIGH_MASK);
struct ti_sci_xfer xfer;
int ret;
- ret = ti_sci_setup_one_xfer(TISCI_MSG_WAIT_PROC_BOOT_STATUS,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ ret = ti_sci_setup_one_xfer(TISCI_MSG_WAIT_PROC_BOOT_STATUS, 0,
&req, sizeof(req),
&resp, sizeof(resp),
&xfer);
return ret;
}
- if (!ti_sci_is_response_ack(&resp))
- return -ENODEV;
-
return 0;
}